<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .frame {
        width: 730px;
        height: 336px;
        margin: 150px auto;
      }
      .box {
        width: 730px;
        height: 336px;
        position: relative;
        transform-style: preserve-3d;
        transition: transform 1s;
        /* overflow: hidden; */
      }
      .box img {
        width: 100%;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;
      }
      .box img:nth-of-type(1) {
        transform: rotateX(0deg) translateZ(180px);
      }
      .box img:nth-of-type(2) {
        transform: rotateX(90deg) translateZ(180px);
      }
      .box img:nth-of-type(3) {
        transform: rotateX(180deg) translateZ(180px);
      }
      .box img:nth-of-type(4) {
        transform: rotateX(270deg) translateZ(180px);
      }
    </style>
  </head>
  <body>
    <div class="frame" id="frame">
      <div class="box">
        <img src="./image/lunbo/01.jpg" />
        <img src="./image/lunbo/02.jpg" />
        <img src="./image/lunbo/03.jpg" />
        <img src="./image/lunbo/04.jpg" />
      </div>
    </div>
    <script>
      var f = document.querySelector('#frame')

      var box = document.querySelector('.box')
      var i = 0
      f.addEventListener('click', function () {
        i++
        //给box绑定属性
        box.style.transform = 'rotateX(' + -i * 90 + 'deg)'
      })
    </script>
  </body>
</html>
